Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@devtools-ds/themes
Advanced tools
Each of the UI components in this project contains themes for multiple browsers. These themes are built using the [postcss-themed](https://github.com/intuit/postcss-themed) package, which allows us to specify themes for multiple browsers in light and dark
Each of the UI components in this project contains themes for multiple browsers. These themes are built using the postcss-themed package, which allows us to specify themes for multiple browsers in light and dark mode.
This package contains colors, types, and React utilities for using browser themes.
npm i @devtools-ds/themes
# or with yarn
yarn add @devtools-ds/themes
You can use the ThemeProvider
component to set the theme for all @devtools-ds
components underneath it.
import { ThemeProvider } from "@devtools-ds/themes";
<ThemeProvider theme={"chrome"} colorScheme={"light"}>
<YourApp />
</ThemeProvider>;
We also provide an AutoThemeProvider
, which will automatically set the theme and color scheme of @devtools-ds
components based on the users browser and preferred color scheme.
<AutoThemeProvider>
<div id="my-app">
<ObjectInspector />
</div>
</AutoThemeProvider>
You can always override the AutoThemeProvider
like a normal ThemeProvider
.
<AutoThemeProvider theme="firefox">
<div id="my-app">
<ObjectInspector />
</div>
</AutoThemeProvider>
You can also have the AutoThemeProvider
automatically change the background color and text color to match the current browser and color scheme. In dark mode, this means the background color will be the browser's dark background and light text.
<AutoThemeProvider autoStyle>
<div id="my-app">
<ObjectInspector />
</div>
</AutoThemeProvider>
If you want to build your own component that leverages the ThemeProvider
, we have a hook that allows you to get the current theme.
import { useTheme } from "@devtools-ds/themes";
const { currentTheme, currentColorScheme } = useTheme(
{ theme, colorScheme },
styles
);
We have created a number of theme variables that have the common colors for different browsers. These are stored as JS objects. You can view the available variables in the Browser Themes
story in Storybook.
import { chrome, firefox } from "@devtools-ds/themes";
chrome.light.gray01;
firefox.dark.blue02;
v0.131.0 (Tue Jan 26 2021)
@devtools-ds/console
, @devtools-ds/dom-inspector
, @devtools-ds/diagnostic
, @devtools-ds/icon
, @devtools-ds/navigation
, @devtools-ds/node
, @devtools-ds/object-inspector
, @devtools-ds/table
, @devtools-ds/tree
, @devtools-ds/storybook-theme-addon
FAQs
Each of the UI components in this project contains themes for multiple browsers. These themes are built using the [postcss-themed](https://github.com/intuit/postcss-themed) package, which allows us to specify themes for multiple browsers in light and dark
The npm package @devtools-ds/themes receives a total of 212,724 weekly downloads. As such, @devtools-ds/themes popularity was classified as popular.
We found that @devtools-ds/themes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.